<template>
	<view class="homecon">
		<u-navbar title="供水调度" :leftIconSize="24" bgColor="#f2f1f6" rightIcon="question-circle" :autoBack="true"
			:placeholder="true" safeAreaInsetTop>
			<view class="u-nav-slot" slot="right">
				<u-icon name="question-circle" color="#000" size="24"></u-icon>
			</view>
		</u-navbar>
		<!-- 图表 -->
		<view class="my_uch">
			<view class="my_tit my_tbyg-a" @click="hoistManual">
				<view class="my_tit_y" style="background-color: #86cd70;">

				</view>
				<image class="img" src="@/static/asddd.png" mode=""></image>
				<view class="my_tit_z">
					手动控制
				</view>
			</view>
			<view class="my_tit my_tbyg-b" @click="hoistCalculation">
				<view class="my_tit_y" style="background-color: #5097ed;">

				</view>
				<image class="img" src="@/static/asdf.png" mode=""></image>
				<view class="my_tit_z">
					开度控制
				</view>
			</view>
			<!-- 			<view class="my_tit my_tbyg-c" @click="hoistPosition">
				<view class="my_tit_y" style="background-color: #edc850;">

				</view>
				<image class="img" src="@/static/asdj.png" mode=""></image>
				<view class="my_tit_z">
					按闸门开度
				</view>
			</view> -->
			<!-- 空转测试 -->
			<view class="my_tbyg-c" @click="idleRunningTest">
				<image class="img" src="@/static/kongzhuan.png" mode=""></image>
				<view class="my_tit_z">
					空转测试
				</view>
			</view>
			<!-- 提示窗示例 -->
			<uni-popup ref="alertDialog" type="dialog">
				<uni-popup-dialog type="success" :showClose="false" confirmText="关闭" title="控制方式">
					<view class="moshi">
						<view class="moshiitem" @click="pointMotionMode">
							<image class="img" src="/static/diandong.png" mode=""></image>
							<view class="text">
								点动模式
							</view>
						</view>
						<view class="moshiitem" @click="lapCountControl">
							<image class="img" src="/static/dingwei.png" mode=""></image>
							<view class="text">
								圈数控制
							</view>
						</view>
					</view>
					</uni-popup-dialog>
			</uni-popup>
		</view>
	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				autoplay: true,
				background: ['color1', 'color2', 'color3'],
				indicatorDots: true,
				autoplay: true,
				interval: 3000,
				duration: 500,
			}
		},
		onLoad(option) {

		},
		onShow() {

		},
		methods: {
			// 弹窗
			idleRunningTest() {
				console.log('打开');
				this.$refs.alertDialog.open()
			},
			// 点动控制
			pointMotionMode() {
				uni.navigateTo({
					url: '/pages/waterSupplyManagement/hoistIdleManual'
				});
				this.$refs.alertDialog.close()
				console.log('点动控制')
			},
			// 圈数控制
			lapCountControl() {
				uni.navigateTo({
					url: '/pages/waterSupplyManagement/hoistIdlePosition'
				});
				this.$refs.alertDialog.close()
				console.log('圈数控制')
			},
			hoistManual() {
				uni.navigateTo({
					url: '/pages/waterSupplyManagement/gateList?toolName=' + '手动'
				});
			},
			hoistCalculation() {
				uni.navigateTo({
					url: '/pages/waterSupplyManagement/gateList?toolName=' + '计算'
				});
			},
			hoistDistance() {
				uni.navigateTo({
					url: '/pages/waterSupplyManagement/gateList?toolName=' + '定距'
				});
			},
			hoistPosition() {
				uni.navigateTo({
					url: '/pages/waterSupplyManagement/gateList?toolName=' + '定位'
				});
			}

		}
	}
</script>
<style scoped lang="scss">
	.tophead {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 80rpx 20rpx 10rpx 20rpx;
		color: #000000;
		background-color: #f3f3f3;
	}

	.homecon {
		.my_uch {

			.my_tit {
				margin: 20rpx;
				padding: 20rpx;
				border-radius: 20rpx;
				background-color: #ffffff;
				display: flex;
				align-items: center;
				justify-content: space-between;
				color: #000000;

				.my_tit_y {
					width: 30rpx;
					height: 50rpx;
					border-radius: 50rpx;
					margin-right: 30rpx;
					background-color: #f2f1f6;
				}

				.img {
					width: 100rpx;
					height: 100rpx;
				}

				.my_tit_z {
					width: 500rpx;
					font-size: 50rpx;
					text-align: center;
					// background-color: #f2f1f6;
				}
			}

			.my_tbyg-a {
				background-color: rgba(134, 205, 112, 0.1);
				border: rgba(134, 205, 112, 0.3) solid 1rpx;
			}

			.my_tbyg-b {
				background-color: rgba(80, 151, 237, 0.1);
				border: rgba(80, 151, 237, 0.3) solid 1rpx;
			}

			.my_tit:active {
				background-color: rgba(170, 255, 255, 0.1);
			}
		}

		// 空转
		.my_tbyg-c {
			padding:  10rpx 20rpx;
			position: fixed;
			color: #000000;
			right: 50rpx;
			bottom: 100rpx;
			border-radius: 10rpx;
			display: flex;
			align-items: center;
			background-color: rgba(237, 200, 80, 0.1);
			border: rgba(237, 200, 80, 0.3) solid 1rpx;
			&:active {
				background-color: rgba(237, 200, 80, 0.5);
			}

			.img {
				width: 40rpx;
				height: 40rpx;
			}

			.my_tit_z {
				margin-left: 10rpx;
				font-size: 35rpx;
				text-align: center;
				// background-color: #f2f1f6;
			}
		}
		// 弹窗
		.moshi {
			display: flex;
			align-items: center;
			justify-content: space-around;
			.moshiitem {
				display: flex;
				align-items: center;
				justify-content: center;
				margin: 0 20rpx;
				padding: 20rpx;
				border-radius: 10rpx;
				background-color: rgba(0, 218, 218, 0.1);
				border: rgba(0, 218, 218, 0.3) solid 1rpx;
				&:active {
					background-color: rgba(0, 218, 218, 0.5);
				}
				.img {
					width: 50rpx;
					height: 50rpx;
					margin-right: 10rpx;
				}
			}
		}
	}

	.u-nav-slot {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 5rpx 10rpx;
	}
</style>

<style>
	page {
		background-color: #f2f1f6;
	}
</style>